bitkeeper revision 1.1159.187.70 (41c82f87JcLj4kF6tbEDtsuLasUe0w)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 21 Dec 2004 14:13:27 +0000 (14:13 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 21 Dec 2004 14:13:27 +0000 (14:13 +0000)
Only GLOBAL-map real Xen heap mappings. Not start-of-day low mappings.

xen/arch/x86/boot/x86_32.S
xen/arch/x86/x86_32/mm.c

index 305c279c5ea8fce29644f67989719032cb96a34d..ef568efd3a263970f6f5399359ad41893a63d60b 100644 (file)
@@ -102,15 +102,15 @@ __start:
 
         /* Initialize low and high mappings of all memory with 4MB pages */
         mov     $idle_pg_table-__PAGE_OFFSET,%edi
-        mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+4MB+GLOBAL */
+        mov     $0xe3,%eax                  /* PRESENT+RW+A+D+4MB */
 1:      mov     %eax,__PAGE_OFFSET>>20(%edi) /* high mapping */
         stosl                                /* low mapping */
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $DIRECTMAP_PHYS_END+0x1e3,%eax
+        cmp     $DIRECTMAP_PHYS_END+0xe3,%eax
         jne     1b
 1:      stosl   /* low mappings cover as much physmem as possible */
         add     $(1<<L2_PAGETABLE_SHIFT),%eax
-        cmp     $__HYPERVISOR_VIRT_START+0x1e3,%eax
+        cmp     $__HYPERVISOR_VIRT_START+0xe3,%eax
         jne     1b
         
         /* Initialise IDT with simple error defaults. */
index ed95ca77e9cebdf0325289cd0389ffaf29a2a5b0..a47e6b63c3b4b5d9cbfa227447bf30dbed23a6a7 100644 (file)
@@ -59,11 +59,13 @@ void __init paging_init(void)
     void *ioremap_pt;
     int i;
 
-    /* Idle page table 1:1 maps the first part of physical memory. */
-    for ( i = 0; i < DOMAIN_ENTRIES_PER_L2_PAGETABLE; i++ )
-        idle_pg_table[i] = 
-            mk_l2_pgentry((i << L2_PAGETABLE_SHIFT) | 
-                          __PAGE_HYPERVISOR | _PAGE_PSE);
+    /* Xen heap mappings can be GLOBAL. */
+    if ( cpu_has_pge )
+    {
+        for ( i = 0; i < DIRECTMAP_PHYS_END; i++ )
+            ((unsigned long *)idle_pg_table)
+                [(i + PAGE_OFFSET) >> L2_PAGETABLE_SHIFT] |= _PAGE_GLOBAL;
+    }
 
     /* Create page table for ioremap(). */
     ioremap_pt = (void *)alloc_xenheap_page();
@@ -86,7 +88,6 @@ void __init paging_init(void)
     /* Set up linear page table mapping. */
     idle_pg_table[LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT] =
         mk_l2_pgentry(__pa(idle_pg_table) | __PAGE_HYPERVISOR);
-
 }
 
 void __init zap_low_mappings(void)